<?php

namespace IDock\Insurance\ZFIC\Request;

use IDock\Insurance\ZFIC\Response\CancelOrderResponse;
use IDock\Insurance\ZFIC\Response\CommonResponse;
use IDock\Visitor\ProposalRecallVisitor;
use IDock\Visitor\UnderwritingRecallVisitor;

class OrderCancelRequest extends AllZFICRequest
{

    protected $urlTip = '投保单回撤接口';

    protected $route = 'order/api/order/proposal_recall';

    protected $response = CancelOrderResponse::class;

    /**
     * @var ProposalRecallVisitor $visitor
     */
    protected $visitor;

    public function generate(): array
    {
        $riskCode = '';
        if(!empty($this->visitor->biInquiryNo)){
            $riskCode = '0808';
        }
        if(!empty($this->visitor->ciInquiryNo)){
            $riskCode = '0801';
        }
        if(!empty($this->visitor->biInquiryNo) && !empty($this->visitor->ciInquiryNo)){
            $riskCode = '0000';
        }
        $param = [
            "platOrderNo" => $this->visitor->argc['platOrderNo'],
            'proposalNo' => $this->visitor->inquiryNo,//投保单号
            'riskCode' => $riskCode,
            'commitTime' => date('Y-m-d'),
            'recallType' => '00',//核保后撤单
        ];
        return $param;
    }

    public function getStaffConfig(&$chalCode, &$userCode)
    {
        $chalCode = $this->visitor->argc['chalCode'] ?? '';
        $userCode = $this->visitor->argc['userCode'] ?? '';
    }


}